www.gusucode.com > 落叶冰点万能企业网站内容管理系统 V9.1 > 落叶冰点万能企业网站内容管理系统 V9.1\code\admin\adminKernel\D_asp_code_str_a.asp
<% '************************************************************** ' 新 动 软 网 站 管 理系统 ' 系统作者: 阮 丁 远(网名:天 下 程 序) ' Copyright (C) 新 动 软 网站 管 理 系 统 版 权 所有 '************************************************************** %> <% if have_added_funb="" then have_added_funb=1 isnnn=0 function isnnum(num1) If isnumeric(num1) = 0 Or IsNull(num1) or num1 = "" Then isnnn=0 else isnnn=1 end if end function function isddat(n1) If n1 = "" Or IsNull(n1) or IsDate(n1)=false Then isnnn=0 else isnnn=1 end if end function function isyn(n1) isnnn=9999 If n1 = true or n1=1 Then isnnn=1 end if If n1 = false or n1=0 Then isnnn=0 end if end function function get_rs_value(num1) execute("rsaaaaaaa1="&rsxxx1112&"("&num1&")") get_rs_value=rsaaaaaaa1 end function Function nohtml(ByVal str) Set regEx = New RegExp If IsNull(str) Or Trim(str) = "" Then nohtml = "" Exit Function End If regEx.Pattern = "(\<.[^\<]*\>)" str = regEx.Replace(str, "") regEx.Pattern = "(\<\/[^\<]*\>)" str = regEx.Replace(str, "") regEx.Pattern = "\[NextPage(.*?)\]" '解决“当在文章模块的频道中发布的是图片并使用分页标签[NextPage]或内容开始的前几行就使用分页标签时,一旦使用搜索来搜索该文时,搜索页就会显示分页标签”的问题 str = regEx.Replace(str, "") str = Replace(str, "'", "") str = Replace(str, Chr(34), "") str = Replace(str, vbCrLf, "") str = Trim(str) nohtml = str End Function Public Function ReplaceBadChar(strChar) If strChar = "" Or IsNull(strChar) Then ReplaceBadChar = "" Exit Function End If 'Dim strBadChar, arrBadChar, tempChar, i strBadChar = "',%,^,&,?,(,),<,>,[,],{,},/,\,;,:,exists,select,update,insert,=," & Chr(34) & "," & Chr(0) & "" arrBadChar = Split(strBadChar, ",") tempChar = strChar For i = 0 To UBound(arrBadChar) tempChar = Replace(tempChar, arrBadChar(i), "") Next ReplaceBadChar = tempChar End Function Function GetSubStr(ByVal str, ByVal strlen, bShowPoint) If str = "" Then GetSubStr = "" Exit Function End If 'Dim l, t, c, i, strTemp str = Replace(Replace(Replace(Replace(str, " ", " "), """, Chr(34)), ">", ">"), "<", "<") l = Len(str) t = 0 strTemp = str If strlen = "" Then strlen = 0 Else strlen = CLng(strlen) End If For i = 1 To l c = Abs(Asc(Mid(str, i, 1))) If c > 255 Then t = t + 2 Else t = t + 1 End If If t >= strlen Then strTemp = Left(str, i) Exit For End If Next If strTemp <> str And bShowPoint = True Then strTemp = strTemp & "…" End If GetSubStr = Replace(Replace(Replace(Replace(strTemp, " ", " "), Chr(34), """), ">", ">"), "<", "<") End Function ComeUrl = Trim(Request.ServerVariables("HTTP_REFERER")) Action = Trim(Request("Action")) FoundErr = False ErrMsg = "" If Right(InstallDir, 1) <> "/" Then strInstallDir = InstallDir & "/" Else strInstallDir = InstallDir End If Site_Sn = Replace(Replace(LCase(Request.ServerVariables("SERVER_NAME") & InstallDir), "/", ""), ".", "") '************************************************* '函数名:gotTopic '作 用:截字符串,汉字一个算两个字符,英文算一个字符 '参 数:str ----原字符串 ' strlen ----截取长度 '返回值:截取后的字符串 '************************************************* function gotTopic(str,strlen) if isnull(str) or str="" then gotTopic="" exit function end if 'dim l,t,c, i str=replace(replace(replace(replace(str," "," "),""",chr(34)),">",">"),"<","<") l=len(str) t=0 for i=1 to l c=Abs(Asc(Mid(str,i,1))) if c>255 then t=t+2 else t=t+1 end if if t>=strlen then gotTopic=left(str,i) & "…" exit for else gotTopic=str end if next gotTopic=replace(replace(replace(replace(gotTopic," "," "),chr(34),"""),">",">"),"<","<") end function '************************************************** '函数名:strLength '作 用:求字符串长度。汉字算两个字符,英文算一个字符。 '参 数:str ----要求长度的字符串 '返回值:字符串长度 '************************************************** function strLength(str) 'ON ERROR RESUME NEXT 'dim WINNT_CHINESE WINNT_CHINESE = (len("中国")=2) if WINNT_CHINESE then 'dim l,t,c 'dim i l=len(str) t=l for i=1 to l c=asc(mid(str,i,1)) if c<0 then c=c+65536 if c>255 then t=t+1 end if next strLength=t else strLength=len(str) end if if err.number<>0 then err.clear end function end if %>